package com.dyh.scdemo.confclient;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
@Author=Joey Wheeler
@Date=2020/10/29 15:42
*/
@RestController
@RequestMapping("/ConfClientController")
@RefreshScope//刷新
public class ConfClientController {

    @Value("${name}")
    public String name;

    @Value("${password}")
    public String password;

    @GetMapping("/name")
    public String name(){
        return String.format("name=%s",name);
    }

    @GetMapping("/password")
    public String password(){
        return String.format("password=%s",password);
    }
}
